// home模块所有的axios请求
import http from "./request.js";
// import支持找同一级文件必须加上./

async function getBanner() {
  let { data } = await http.get("/banner/list");
  return data;
}
//请求轮播图数据

async function getArticalList() {
  let { data } = await http.get("/cms/news/list");
  return data;
}
//获取文章列表

async function getRecommendList() {
  let { data } = await http.get("/shop/goods/list");
  return data;
}
//获取人气推荐列表

async function getGoodDetail(params) {
  let { data } = await http.post("/shop/goods/detail?id=" + params.id);
  return data;
}
//请求商品详情的数据

async function getActPrice(params) {
  let { data } = await http.post(
    `/shop/goods/price?goodsId=${params.goodsId}&propertyChildIds=${params.propertyChildIds}`
  );
  return data;
}

//选择规格后获取确切的价格
export {
  getBanner,
  getArticalList,
  getRecommendList,
  getGoodDetail,
  getActPrice,
};
